package com.wpfly.SpringBootDemo.service;

import com.wpfly.SpringBootDemo.dao.StudentDao;
import com.wpfly.SpringBootDemo.entity.Student;
import com.wpfly.SpringBootDemo.entity.StudentForList1;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class StudentService {

    @Autowired
    private StudentDao studentDao;

    public Student save(Student student)
    {
        return studentDao.save(student);
    }

    public Student find(String name)
    {
        return studentDao.findByIdd(name);
        //return studentDao.findById(id).orElse(new Student());
    }

    public Student findByNameLike(String name)
    {
        return studentDao.findByNameLike(name);
    }

    public List<StudentForList1> getStudentList1(List<Long> ids)
    {
        return studentDao.getStudentList1(ids);
    }
}
